###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file and a complete list of statements and
## options, please have a look in the Monit manual.
##
##
###############################################################################
## Global section
###############################################################################
##
## Start Monit in the background (run as a daemon):
#
set daemon  30              # check services at 30 seconds intervals
#   with start delay 240    # optional: delay the first check by 4-minutes (by
#                           # default Monit check immediately after Monit start)
#
#
## Set syslog logging. If you want to log to a standalone log file instead,
## specify the full path to the log file
#
set log {{ elk_path.logs }}/monit/monit.log
set idfile {{ elk_path.data }}/monit/.monit.id
set pidfile {{ elk_path.data }}/monit/monit.pid
set statefile {{ elk_path.data }}/monit/.monit.state

## for this is that the Monit client uses the HTTP interface to send these
## commands to a running Monit daemon. See the Monit Wiki if you want to
## enable SSL for the HTTP interface.
#
set httpd port {{ monit_api_port }} and
    use address {{ monit_api_addr }}
    allow {{ pre_tasks_network_info.network }}/{{ pre_tasks_network_info.prefix }}
    allow {{ monit_api_user }}:{{ monit_api_pass }}

###############################################################################
## Includes
###############################################################################
##
## It is possible to include additional configuration parts from other files or
## directories.
#
include {{ monit_link_path }}/monit.d/*

## Set limits for various tests.
##
set limits {
    programOutput:     512 B,           # check program's output truncate limit
    sendExpectBuffer:  256 B,           # limit for send/expect protocol test
    fileContentBuffer: 512 B,           # limit for file content test
    httpContentBuffer: 1 MB,            # limit for HTTP content test
    networkTimeout:    5 seconds        # timeout for network I/O
    programTimeout:    300 seconds      # timeout for check program
    stopTimeout:       300 seconds      # timeout for service stop
    startTimeout:      300 seconds      # timeout for service start
    restartTimeout:    300 seconds      # timeout for service restart
    execTimeout:       300 seconds      # timeout for test action exec
}
